// element-plus中关于ruleItem类型时由async-validator这个库引进
// function(source, [options], callback): Promise
export const checkEmail = (rule:any,value:string,callback:any) => {
    console.log("进入邮箱验证")
    const regEmail = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
    if(regEmail.test(value)){
        return callback()
    }
   return callback(new Error("请输入合法的邮箱"))
}


export const checkMobile = (rule:any,value:string,callback:any) => {
    const regMobile = /^(13[0-9]|14[5|7]|15[0-9]|18[0-9])\d{8}$/
    if(regMobile.test(value)){
        return callback()
    }
    return callback(new Error("请输入合法的手机号"))
}